<?php if (!defined('THINK_PATH')) exit(); /*a:9:{s:68:"D:\wwwroot\cms\template/index_style/toutiao/cms\content/pc_show4.htm";i:1610160174;s:60:"D:\wwwroot\cms\template/index_style/toutiao/index/layout.htm";i:1612148536;s:63:"D:\wwwroot\cms\template\index_style\default\index\min_login.htm";i:1609243498;s:65:"D:\wwwroot\cms\template\index_style\toutiao\cms\content\guide.htm";i:1591605697;s:69:"D:\wwwroot\cms\template\index_style\default\cms\content\voice_inc.htm";i:1610103403;s:70:"D:\wwwroot\cms\template\index_style\default\cms\content\common_inc.htm";i:1610103399;s:70:"D:\wwwroot\cms\template\index_style\default\cms\content\comment_pc.htm";i:1609243498;s:66:"D:\wwwroot\cms\template\index_style\toutiao\cms\content\zuozhe.htm";i:1610162045;s:62:"D:\wwwroot\cms\template\index_style\toutiao\index\weixingz.htm";i:1545783578;}*/ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $info['title']; ?></title>
<meta name="keywords" content='<?php echo $info['title']; ?> <?php echo get_sort($info['fid']); ?>  <?php echo M('name'); ?>'>
<meta name="description" content='<?php echo get_word(del_html($info['content']),300); ?>'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="shortcut icon" type="image/x-icon" href="/public/static/index/toutiao/favicon.ico">
<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/reset.css">
<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/cms.css">
<link rel="stylesheet" href="/public/static/css/qb_ui.css">
<link rel="stylesheet" href="/public/static/icon/icon.css">
<script type="text/javascript" src="/public/static/js/core/jquery.min.js"></script>
<script type="text/javascript" src="/public/static/layer/layer.js"></script>
<script type="text/javascript" src="/public/static/index/toutiao/kefu.js"></script>
</head>

<body>
<!--下面是钩子插件,做风格的时候尽量加上,方便扩展  -->
<?php echo hook_listen('layout_body_head',$userdb,['webdb'=>$webdb,'info'=>$info],true); ?>
<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/head.css">
<div class="TopContBox">
	<ul>
		<ol><a href="$webdb[www_url]" class="home"><img src="/public/static/index/toutiao/home.png"></a></ol>
		<li>
<div class="qb_pc_topBox">
	<ul>		
<?php if(!(empty($userdb) || (($userdb instanceof \think\Collection || $userdb instanceof \think\Paginator ) && $userdb->isEmpty()))): ?>
		<ol><?php echo $userdb['username']; ?> 您好！欢迎来到<?php echo $webdb['webname']; ?></ol>
		<li><a href="<?php echo get_url('member'); ?>" target="_blank">进入会员中心</a> <a href="<?php echo get_url('quit'); ?>" target="_blank">安全退出</a></li>
<?php else: ?>
		<ol>您好！欢迎来到<?php echo $webdb['webname']; ?></ol>
		<li>
			<form action="<?php echo urls('index/login/index'); ?>" method="post">
	<input type="hidden" name="fromurl" value="<?php echo get_url('location'); ?>">
	<div class="qb_ui_TopLoginBox">
		<span>通行证</span>
		<span><input type="text" name="username" minlength="2" placeholder="输入帐号" required/></span>
		<span><input type="password" name="password" minlength="5" placeholder="输入密码" required/></span>
		<span><button type="submit">登录</button></span>
		<span><a href="<?php echo get_url('reg'); ?>">注册</a> | <a href="<?php echo get_url('login'); ?>">登录</a></span>
		<span><a href="<?php echo purl('login/qq/index'); ?>" class="fa fa-qq"> 登录</a></span>
		<span><a href="<?php echo purl('weixin/login/index'); ?>" class="fa fa-weixin"> 登录</a></span>
		<span><a href="<?php echo urls('index/login/phone'); ?>" class="fa fa-fw fa-mobile-phone"> 登录</a></span>
	</div>
</form>
		</li>
<?php endif; ?>
	</ul>
</div>
		</li>
	</ul>
</div>


<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/guide.css">
<div class="BencandyHead">
	<div class="InBox">
		<dl>
			<dt>
				<ul>
					<ol><?php if(defined('LABEL_DEBUG')): ?><!--QB <!--toutiaologo	image	--><a href="/"><img src="/public/static/index/toutiao/logo.png" width="104"></a> QB--><?php endif; $toutiaologo = fun('label@run_label','toutiaologo',['val'=>'','conf'=>'','list'=>'rs','systype'=>'image','tpl'=>'','ifdata'=>1,'dirname'=>__FILE__,'rows'=>'5','class'=>'','order'=>'','by'=>'','where'=>'','whereor'=>'','sql'=>"",'js'=>'','cache_time'=>'0'  ]); ?></ol>
					<li>
<a href='/' class="home">网站首页</a> -&gt; 

<!-- 频道 -->
<?php $array = config('system_dirname') ? modules_config(config('system_dirname')):''; if($array): $url=iurl(config('system_dirname').'/index/index'); ?>
<a href="<?php echo $url; ?>"><?php echo $array['name']; ?></a>
<?php endif; ?>
<!-- 栏目 -->
<?php $array=[];if($fid&&$_name=sort_config()[$fid]['name'])$array=empty($array=sort_get_father($fid))?[$fid=>$_name]:$array+[$fid=>$_name];foreach($array AS $key=>$name):$url=iurl(config('system_dirname').'/content/index',['fid'=>$key]); ?>
 -&gt; <a href="<?php echo $url; ?>"><?php echo $name; ?></a>
<?php endforeach; ?>
<!-- 自定义标题与链接 -->
<?php if($link_name!=''): $url=$link_url?$link_url:'#'; ?>
<a href="<?php echo $url; ?>"><?php echo $link_name; ?></a>
<?php endif; ?>
					</li>
				</ul>
			</dt>
			<dd>
				<div class="SearchBox1">
					<form method="get" action="<?php echo urls('search/index/lists'); ?>" onsubmit="return cksearch();" target="_blank">
						<div class="input"><input id="keyword_s" type="text" name="keyword" placeholder='请输入关键字'/></div>
						<div class="sub"><input name="button" type="submit" value="搜索"/></div>
					</form>
<script type="text/javascript">
<!--
function cksearch(){
	if ($('#keyword_s').val()==''){
		layer.alert("关键字不能为空");
		return false;
	}
}
//-->
</script> 
				</div>
			</dd>
		</dl>
	</div>
</div>
<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/bencandy.css">
<div class="MainContainer">
	<div class="LeftCont">
<div class="bshareBox">
		<div class="comment"><?php echo fun('comment@total',$id); ?></div>
		<div class="bshare-custom">
			<a title="分享到新浪微博" class="bshare-sinaminiblog">微博</a>
			<a title="分享到QQ空间" class="bshare-qzone">Qzone</a>
			<a title="分享到微信" class="bshare-weixin">微信</a>        
			<!--a class="bshare-facebook">On Facebook</a-->			
			<!--a class="bshare-twitter">On Twitter</a-->			
			<!--a title="分享到Google+" class="bshare-gplus"></a-->
			<!--a title="分享到QQ好友" class="bshare-qqim"></a-->
		</div>
<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></script>
<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
	</div>
	</div>
	<div class="CenterContainer">
<div class="Articletitle"><?php echo $info['title']; ?></div>
		<div class="top_about">
			<?php echo date("Y-m-d H:i:s",$info['create_time']); ?>
			浏览:<span><?php echo $info['view']; ?></span>次
			【<a href="javascript:doZoomSize(18)">大</a> <a href="javascript:doZoomSize(14)">中</a> <a href="javascript:doZoomSize(12)">小</a>】
		</div>
		<div class="ArticleContent"><?php echo $info['content']; ?>
		
		<!----------音乐播放器开始-------->
<link rel="stylesheet" href="/public/static/libs/jplayer/css/style.css"/>
<style type="text/css">
#voice{
	width:100%;
    height:600px;    
    margin:0 auto;
}
</style>
<div id="voice"></div>
<script src="/public/static/libs/jplayer/ttw-clarity-player.js?3"></script>
<script src="/public/static/libs/jplayer/yepnope.js"></script>
<script type="text/javascript">
var clarity;
$(function () {
        var myPlaylist = [
		/*
            {
                mp3:'<?php echo $info['voice_url'][0]['url']; ?>',
                duration:'2:21',
                cover:'<?php echo (isset($info['picurl']) && ($info['picurl'] !== '')?$info['picurl']:"/public/static/libs/jplayer/css/images/bg.jpg"); ?>',
                title:'<?php echo $info['title']; ?>',
                artist:'<?php echo get_user_name($info['uid']); ?>',
                background:'',
            },
		*/
<?php if(is_array($info['voice_url']) || $info['voice_url'] instanceof \think\Collection || $info['voice_url'] instanceof \think\Paginator): $i = 0; $__LIST__ = $info['voice_url'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;$rs['title']||$rs['title']=$info['title'].'(第'.$i.'段)'; ?>
			{
                mp3:"<?php echo $rs['url']; ?>",
                duration:'2:21',
                cover:'<?php echo (isset($info['picurl']) && ($info['picurl'] !== '')?$info['picurl']:"/public/static/libs/jplayer/css/images/bg.jpg"); ?>',
                title:'<?php echo $rs['title']; ?>',
                artist:'<?php echo get_user_name($info['uid']); ?>',
                background:'',
            },
<?php endforeach; endif; else: echo "" ;endif; $_result=fun('content@next_more',$info,3);if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;$array=json_decode($rs['voice_url'],true);$voice_url=tempdir($array[0]['url']); ?>
			{
                mp3:'<?php echo $voice_url; ?>',
                duration:'3:55',
                cover:"<?php echo tempdir($rs['picurl']?:'/public/static/libs/jplayer/css/images/bg.jpg'); ?>",
                title:'<?php echo $rs['title']; ?>',
                artist:'<?php echo get_user_name($rs['uid']); ?>',
                background:'',
				next_topic:true,
            },
<?php endforeach; endif; else: echo "" ;endif; ?>
			 
        ];
		
        clarity = $('#voice').ttwClarityPlayer(myPlaylist,{
				jPlayer:{
					supplied:'mp3',
					errorAlerts:true,	
					autoPlay:true,				
					warningAlerts:true,
					consoleAlerts:true,
					smoothPlayBar:true,
					timeupdate:function (e) {
						var time = parseInt(e.jPlayer.status.currentTime);
						console.log(time);
						if(typeof(api_player_time)=='function'){
							api_player_time(time);
						}
					},
					play:function(){
						if(typeof(api_player_play)=='function'){
							api_player_play();
						}
					},
					pause:function(){
						if(typeof(api_player_pause)=='function'){
							api_player_pause();
						}
					},
					ended:function() {
						if(typeof(api_player_ended)=='function'){
							api_player_ended();
						}
					},
					ready: function (e) {
						if(typeof(api_player_ready)=='function'){
							api_player_ready();
						}
						//$(this).jPlayer("pause",5);
					},
					error:function(event){
						if(typeof(api_player_error)=='function'){
							api_player_error();
						}
						//$(".jp-next").trigger("click");
					},
				}
			});

        setTimeout(function(){
			clarity.play();		//自动播放
			play_url();			//URL指定播放哪辑
		}, 1500 );

		//$('#voice-size-picker').on('click', 'li', function(){
        //    $('#voice').attr('data-size', $(this).data('size'));
        //    clarity.manageLayout();
        //});
});
</script>
<!------------音乐播放器结束---------->
		</div>
<!----音频列表开始---->
<style type="text/css">
.more_list{
	margin:10px 0 10px 0;
}
.more_list .list{
	line-height:34px;
}
.more_list .list a{
	background:#eee;
	color:#333;
	padding:4px 9px 4px 10px;
	font-size:14px;
}
.more_list .list a:hover{
	color:yellow;
}
.more_list .list .choose{
	font-weight:bold;
	color:#f60;
}
.more_list .fav_ck{
	color:#999;
}
.more_list em{
	font-size:14px;
}
.more_list .money{
	margin-left:20px;
}


.total_price{
	margin:10px 0 10px 0;
	background:#eee;
	text-align:center;
	color:#333;
	font-size:15px;
	line-height:35px;
	border-radius:5px;
	display:none;
}
.total_price span{color:#f30; margin-left:5px; margin-right:5px;}
.total_price .buy{ background:#f60; color:#fff; padding:5px 10px; border-radius:5px;}
.total_price a{
	color:#f30;
}
.total_price a:hover{
	color:red;
}
</style>

<?php if($info['price']>0&&count($info['voice_url'])>1): ?>
<div class="total_price">本内容全包价只需<span><?php echo $info['price']; ?></span>元，比单节购买更划算，<a href="javascript:" data-money="<?php echo $info['price']; ?>" class="buy">点击购买</a></div>
<?php elseif($info['price']>0): ?>
<div class="total_price">本内容收费<span><?php echo $info['price']; ?></span>元，<a href="javascript:" data-money="<?php echo $info['price']; ?>" class="buy">点击购买</a></div>
<?php endif; ?>

	<div class="more_list" style="<?php echo count($info['voice_url'])<2?'display:none;':''; ?>">
			<?php if(is_array($info['voice_url']) || $info['voice_url'] instanceof \think\Collection || $info['voice_url'] instanceof \think\Paginator): $i = 0; $__LIST__ = $info['voice_url'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;$rs['title']||$rs['title']=$info['title'].'(第'.$i.'节)'; ?>
				<div class="list">第<?php echo $i; ?>节、<a href="javascript:;" onclick="change_play(<?php echo $key; ?>,$(this))"><i class="fa fa-play"></i> <?php echo $rs['title']; ?></a>
				<em class="fav fa fa-star-o" onclick="add_fav(<?php echo $id; ?>,<?php echo $key; ?>)">收藏</em>
				<em class="money fa fa-lock"> 免费</em>
				</div>
			<?php endforeach; endif; else: echo "" ;endif; ?>
	</div>


<!----音频列表结束---->

<!--用到的JS-->
<script type='text/javascript'>

function next_voice(){ //下一首
	var url = "<?php echo fun('content@next_url',$info,'list'); ?>";
	if(url!=""){
		window.location.href = url+"#miao";
	}else{
		layer.alert('全部播放完了!');
	}
}
function prev_voice(){ //上一首
	var url = "<?php echo fun('content@prev_url',$info,'list'); ?>";
	if(url!=""){
		window.location.href = url+"#miao";
	}else{
		layer.alert('到尽头了!');
	}
}

function change_play(index,obj){	//切换哪一首
	layer.msg("请稍候,音频加载中...");
	clarity.paythis(index)
	$(".more_list a").removeClass('choose');
	obj.addClass('choose');
}

var play_index = 0;	//当前播放哪一首

function now_play_voice(index){	//当前正在播放第几首
	play_index = index;
	$(".more_list a").removeClass('choose');
	$(".more_list a").eq(index).addClass('choose');

//	setTimeout(function(){
//		play_log(play_index,3);//播放记录
//	}, 3000 );
}


//var remind_pay = true;

//检查是否需要付费
//window.setInterval(function(){
//	var playtime = $('.jp-current-time').html().replace(':','.');
	//console.error('error'+playtime);
//	if(url_money[play_index]>0 && playtime>1){	//playtime>1只能试听一分钟
//		clarity.pause();
//		if(remind_pay==true){
//			remind_pay = false;
//			layer.confirm("需要支付 "+url_money[play_index]+" 元,才能继续播放,你还要继续吗?",{btn:['继续','放弃'],title:false,cancel:function(){}},function(){
//				pay_money(url_money[play_index],play_index)
//			},function(){});
//		}
//	}
//},2000);


function player_stop(){
	clarity.pause();
}

function player_start(){
	clarity.play();
}


</script>
<style type="text/css">
.youhui{
	margin:20px;
	font-size:14px;
	line-height:200%;
}
.youhui .y_money{
	color:red;
	font-weight:bold;
}
.youhui .y_endtime{
	color:blue;
}
</style>
<div style="display:none" id="youhui_msg">
	<div class="youhui">
		恭喜你，领取到一张面值 <em class="y_money">0</em> 元的优惠券<br> 
		只有购买全集内容 <?php echo $info['price']>0?$info['price']:get_total_money($info); ?> 元，才可抵扣使用。
		<br> 有效期截止于：<em class="y_endtime">2020-12-12 23:59</em>
		<br> 是否立即使用？
	</div>
</div>

<script type='text/javascript'>
//添加到收藏
function add_fav(id,sid){
	var url="<?php echo urls('wxapp.fav/add'); ?>?type=1&id="+id+"&sid="+sid;
	$.get(url,function(res){
		if(res.code==0){
			layer.msg('收藏成功');
		}else{
			layer.alert(res.msg);
		}
	})
}

$(function(){
	//检查是否已收藏
	$(".more_list .fav").each(function(i){
		var that = $(this);
		$.get("<?php echo urls('wxapp.fav/check'); ?>?id=<?php echo $id; ?>&type=1&sid="+i,function(res){
			if(res.code==0){
				that.addClass('fav_ck');
				that.html('已收藏');
			}
		});
	});
});


function play_url(){	//URL指定播放哪辑
	<?php if(input('sid')>0): ?>
		change_play(<?php echo input('sid'); ?>,$(".more_list .list").eq(<?php echo input('sid'); ?>).find('a'));
	<?php endif; ?>
}

//监听内容播放的时间变动,此函数是反复执行的
function api_player_time(time){
	play_log(play_index,time);//播放记录	

	remind_pay(time); //提醒用户付费
}

var ck_time = 0;
function play_log(sid,playtime){	//播放记录
	if(ck_time!=playtime && playtime>2 && playtime%2==0){	//大于两秒才做记录,每两秒更新一次.
		ck_time = playtime;
		$.get("<?php echo urls('wxapp.fav/update'); ?>?id=<?php echo $id; ?>&playtime="+playtime+"&sid="+sid,function(res){});					
	}	
}


//提醒用户付费
function remind_pay(time){
	var limit_time = (typeof(media_type)=='string'&&media_type=='mv') ? 10 : 15 ; //视频只能试看10秒,音频可以听15秒

	if (typeof(player1)=='object' && url_money[play_index] > 0) {
        var attribute = {
            list: [{
                type: 'text', //说明是文本
                text: '您可以免费观看'+limit_time+' 秒，需要支付' + url_money[play_index] + "元，才能观看完整版", //文本内容
                color: '0xFFFFFF', //文本颜色
                size: 14, //文本字体大小，单位：px
                leading: 30, //文字行距
                alpha: 1, //文本透明度(0-1)
                paddingLeft: 10, //文本内左边距离
                paddingRight: 10, //文本内右边距离
                paddingTop: 0, //文本内上边的距离
                paddingBottom: 0, //文本内下边的距离
                marginLeft: 0, //文本离左边的距离
                marginRight: 10, //文本离右边的距离
                marginTop: 10, //文本离上边的距离
                marginBottom: 0, //文本离下边的距离
                backgroundColor: "#000000", //文本的背景颜色
                backAlpha: .5, //文本的背景透明度(0-1)
                backRadius: 10, //文本的背景圆角弧度
                clickEvent: "actionScript->videoPlay"
            }],
            x: 10, //元件x轴坐标，注意，如果定义了position就没有必要定义x,y的值了，x,y支持数字和百分比，使用百分比时请使用单引号，比如'50%'
            y: 500, //元件y轴坐标
        }
        player1.addElement(attribute);
    }
	
	if(url_money[play_index]>0 && time>limit_time){
		player_stop();
		$("#player_warp").hide(500);
		layer.confirm("需要支付 "+url_money[play_index]+" 元,才能继续播放,你愿意支付吗?",{btn:['愿意支付','放弃']},function(){
			pay_money(url_money[play_index],play_index)
		});
	}
}


var url_money = [];	//需要付费的

$(function(){
	//检查收费权限
	$(".more_list .money").each(function(i){
		var that = $(this);
		$.get("<?php echo urls('wxapp.buy/check'); ?>?id=<?php echo $id; ?>&sid="+i,function(res){
			url_money[i] = 0;
			if(res.code==0){ //无须付费或已付费
				if(<?php echo $info['price']; ?>>0 && res.data.money>=<?php echo $info['price']; ?>){	//每集不单独收费,只收统一的包集费
					that.removeClass('fa-lock');
					that.addClass('fa-unlock');
					that.html('全包价:<?php echo $info['price']; ?>元');
				}else if(res.data.money>0){	//按每集收费
					that.removeClass('fa-lock');
					that.addClass('fa-unlock');
					that.html('单价:'+res.data.money+'元');
				} else{	//免费的
					that.hide();
				}
			}else if(res.code==1){	//需要付费的
				if(<?php echo $info['price']; ?>>0 && res.data.money>=<?php echo $info['price']; ?>){	//不单独收费,收统一全包集费
					url_money[i] = <?php echo $info['price']; ?>;
					that.html('全包价:<?php echo $info['price']; ?>元');
				}else if(res.data.money>0){	   //按每集单独收费
					url_money[i] = res.data.money;
					that.html('单价:'+res.data.money+'元');
				} 
				that.click(function(){
					pay_money(url_money[i],i);
				});

				//处理主题收费购买事件
				$(".total_price").show();
				$(".total_price .buy").click(function(){
					pay_money($(this).data("money"),-1);
				});
			}
		});
	});
});

//根据每一集付费
function pay_money(money,sid,yid){
	if("<?php echo $userdb['uid']; ?>"==""){
		layer.confirm('登录后才能支付，你还没登录，你要马上登录吗？',{btn:['马上登录','取消']},function(){
			window.location.href = "<?php echo get_url('login'); ?>";
		});
		return ;
	}
	layer.msg('请稍候...');

	if(typeof(yid)=='undefined' || yid<1){	//看看帐户中是否有优惠券可以使用
		$.get("<?php echo urls('wxapp.buy/list_youhui',['id'=>$id]); ?>",function(res){
			if(res.code==0){
				layer.closeAll();
				var rs = res.data[0];
				if(sid==-1){
					layer.alert('你有一张面额为 '+rs.money+' 元的优惠券可抵扣使用。',{},function(){
						confrim_buy(money-rs.money,sid,rs.id);	//购买全集
					});
				}else{
					layer.confirm('你有一张面额为 '+rs.money+' 元的优惠券可抵扣使用，但是需要你购买全集才能使用，你要购买全集吗？',{btn:['用券低扣，购买全集','不用券，只买单集']},function(){
						money = <?php echo $info['price']>0?$info['price']:get_total_money($info); ?> - rs.money; //抵扣后的优惠价 
						confrim_buy(money,-1,rs.id);	//购买全集
					},function(){
						confrim_buy(money,sid,0);
					});
				}
				
			}else{
				confrim_buy(money,sid,0);
			}
		});
	}else{	//指定了使用某张优惠券
		confrim_buy(money,sid,yid);
	}
}

function confrim_buy(money,sid,youhui_id){
	layer.confirm("你确认要支付 "+money+" 元吗?",{btn:['确认支付','取消']},function(){
		$.get("<?php echo urls('wxapp.buy/pay',['id'=>$id]); ?>?sid="+sid+"&yid="+youhui_id,function(res){
			if(res.code==2){
				layer.confirm('你的可用余额不足'+money+'元,你需要现在充值吗?',{btn:['立即充值','以后再说']},function(){
					window.location.href = res.data.url;
				});
			}else if(res.code==0){
				layer.closeAll();				
				if(sid!=-1){
					layer.msg('支付成功,可以播放了!');
					$("#player_warp").show();
					url_money[sid] = 0;				
					player_start();
				}else{
					layer.msg('支付成功!');
					$("#player_warp").show();
					window.location.reload();
				}
			}else{
				alert(res.msg);
			}
		});
	});
}



$(function(){
	var yid = parseInt("<?php echo input('yid'); ?>"==""?0:"<?php echo input('yid'); ?>");	//优惠券ID
	if(yid>0){
		$.get("<?php echo urls('wxapp.buy/get_youhui',['id'=>$id]); ?>?yid="+yid,function(res){
			if(res.code==0){
				if(res.data.ifuse>0){
					return ; //已使用过，就不要再弹出提示
				}
				$("#youhui_msg .y_money").html(res.data.money);
				$("#youhui_msg .y_endtime").html(res.data.end_time);
				layer.open({
					type:1,
					content:$("#youhui_msg"),
					shift: 1,
					title:false,
					btn:['立即使用','以后再说'],
					yes:function(){
						layer.closeAll();
						var money = <?php echo $info['price']>0?$info['price']:get_total_money($info); ?> - res.data.money; //抵扣优惠券的价格
						pay_money(money,-1,yid)
					}
				});
			}else{
				layer.alert(res.msg);
			}
		})
	}
});
</script>

		<div class="showpage"><?php echo $pages; ?></div>
				<!--自定义字段-->
		<?php if(defined('LABEL_DEBUG')): ?><!--SHOWPAGE <!--d41d8cd98f00b204e9800998ecf8427e		--><?php if(is_array($info) || $info instanceof \think\Collection || $info instanceof \think\Paginator): $i = 0; $__LIST__ = $info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
       <div class="SideBox">
			<div class="tag"><span><?php echo $rs['title']; ?></span></div>
			<div class="cont"><?php echo $rs['value']; ?></div>
		</div>
  <?php endforeach; endif; else: echo "" ;endif; ?> SHOWPAGE--><?php endif; fun('label@run_showpage_label','d41d8cd98f00b204e9800998ecf8427e',$info,['page'=>$page,'dirname'=>__FILE__,'tpl'=>'','field'=>'picurl,title,content','val'=>'info','cache_time'=>'0']); ?>
		<!--引用评论碎片-->
		<?php if(defined('LABEL_DEBUG')): ?><!--COMMENT<!--commentpc01		-->
			
<link rel="stylesheet" href="/public/static/css/pccomment.css"> 
<div class="WapCommentBox">
	<ul class="PostCommentBox1">
		<ol><i class="fa fa-edit"></i><textarea placeholder="发布您的精彩评论"></textarea></ol>
		<li><button type="butter" onclick="post_commentPc()">发表</button></li>		
	</ul>
	<div class="head">
		<div class="tag">全部评论(<?php echo $total; ?>)</div>
	</div>
	<div class="ListComment">
		<?php if(is_array($listdb) || $listdb instanceof \think\Collection || $listdb instanceof \think\Paginator): $i = 0; $__LIST__ = $listdb;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
		<ul class="lists" id="comment_cnt_<?php echo $rs['id']; ?>">
			<ol class="icon"><a href="<?php echo get_url('user',$rs['uid']); ?>" target="_blank"><img src="<?php echo $rs['icon']; ?>" onerror="this.src='/public/static/images/nobody.gif'"/></a></ol>
			<li class="infos">
				<dl>
					<dt><a href="<?php echo murl('member/msg/add',['uid'=>$rs['uid']]); ?>" class="_pop"><?php echo $rs['username']; ?></a> <span><?php echo $rs['time']; ?></span></dt>
					<dd>
						<em onclick="dingcomment(<?php echo $rs['id']; ?>)"><i class="si si-like"></i> <a class="agree<?php echo $rs['id']; ?>"><?php echo $rs['agree']; ?></a></em> 
						<span onclick="post_comment(<?php echo $rs['id']; ?>)"><i class="fa fa-commenting-o"></i> 回复</span>
						<?php if($rs['uid']==login_user('uid')||login_user('groupid')==3): ?><span onclick="del_comment(<?php echo $rs['id']; ?>)"><a href="javascript:"><i class="fa fa-close"></i> 删除</a></span><?php endif; ?>
					</dd>
				</dl>
				<div class="comment"><?php echo $rs['content']; ?></div>				
				<div class="repalyinfs repalyinfs<?php echo $rs['id']; ?>">
					<?php if(is_array($rs['children']) || $rs['children'] instanceof \think\Collection || $rs['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $rs['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
					<div id="comment_cnt_<?php echo $vo['id']; ?>">
						<a href="<?php echo get_url('user',$vo['uid']); ?>" target="_blank"><?php echo (isset($vo['username']) && ($vo['username'] !== '')?$vo['username']:'游客'); ?>：</a>
						<?php echo $vo['content']; if($vo['uid']==login_user('uid')||login_user('groupid')==3): ?><span onclick="del_comment(<?php echo $vo['id']; ?>)" style="float:right;"><a href="javascript:"><i class="fa fa-close"></i> 删除</a></span><?php endif; ?>
					</div>
					<?php endforeach; endif; else: echo "" ;endif; ?>
				</div>
			</li>
		</ul>
		<?php endforeach; endif; else: echo "" ;endif; ?>
	</div>
	<div class="ShowMoreComment"><button type="butter" onclick="ShowMoreComment()">更多评论 <i class="fa fa-angle-double-down"></i></button></div>
</div>
<script type="text/javascript">
	var posturl,baseurl;
	posturl=baseurl="{posturl}";
	var repalyid=0;
	var commentpage=1;
	function post_comment(pid){			
		if(pid>0){
			repalyid=pid;
			posturl=baseurl+"?pid="+pid;
		}
		layer.open({
		  type: 1,
		  skin: 'layui-layer-demo', //样式类名
		  area: ['320px', '280px'], //宽高
		  closeBtn: 0, //不显示关闭按钮
		  anim: 2,
		  shadeClose: true, //开启遮罩关闭
		  content: '<ul class="PostCommentBox"><ol><textarea placeholder="请输入评论内容"></textarea></ol><li><button type="butter" onclick="post_comment1()">发表</button><button type="butter" onclick="layer.closeAll()">取消</button></li></ul>'
		});
	}
	
function del_comment(id){
	layer.confirm('你确认要删除吗？',function(){
		$.get("<?php echo purl('comment/api/delete'); ?>?ids="+id,function(res){
			if(res.code==0){
				layer.msg('删除成功');
				$("#comment_cnt_"+id).hide();
			}else{
				layer.alert(res.msg);
			}
		});
	});
}

	//引用评论
	function post_comment1(){
		var contents=$('.PostCommentBox textarea').val();
		if(contents==''){
			layer.alert("请输入评论内容！");
		}else{
			$.post(
				posturl,
				{content:contents},
				function(res,status){
					if(res.code==0){
						if(repalyid>0){
							$('.repalyinfs'+repalyid).html(res.data);
						}else{
							$('.ListComment').html(res.data);
							commentpage=1;
							//$('.ShowMoreComment').fadeIn();
						}
						layer.closeAll(); //疯狂模式，关闭所有层
						layer.msg('发表成功！');
						HiddenShowMoreComment();
					}else{
						layer.alert('评论发表失败:'+res.msg);
					}
				}
			);				
		}			
	}
	
	
	function post_commentPc(){
		var contents=$('.PostCommentBox1 textarea').val();
		if(contents==''){
			layer.alert("请输入评论内容！");
		}else{
			$('.PostCommentBox1 textarea').val('评论发表中……');
			$('.PostCommentBox1 li').html('<span>发表中</span>');
			$.post(
				posturl,
				{content:contents},
				function(res,status){
					$('.PostCommentBox1 textarea').val('');
					$('.PostCommentBox1 li').html('<button type="butter" onclick="post_commentPc()">发表</button>');
					if(res.code==0){
						$('.ListComment').html(res.data);
						commentpage=1;
						layer.msg('发表成功！');
						HiddenShowMoreComment();
					}else{
						layer.alert('评论发表失败:'+res.msg);
					}
				}
			);				
		}
	}

	function dingcomment(id){
			var agree=parseInt($('.agree'+id).html());
			$.get('{posturl}?agree=1&id='+id+'&'+Math.random(),function(res){
				if(res.code==0){
					agree++;
					$('.agree'+id).html(agree);
					layer.msg('点赞成功！');
				}else{
					layer.alert('点赞失败:'+res.msg);
				}
			});
	}
		
	function ShowMoreComment(){
			commentpage++;
			$.get('{pageurl}?page='+commentpage+'&'+Math.random(),function(res){
				if(res.code==0){
					if(res.data==''){
						layer.msg('显示完了！');
						$('.ShowMoreComment').fadeOut();
					}else{
						res.data="<div class='pages"+commentpage+"'>"+res.data+"</div>";			
						$('.ListComment').append(res.data);
						$('.ListComment .pages'+commentpage).hide();
						$('.ListComment .pages'+commentpage).show(500);
					}
				}else{
					layer.msg(res.msg,{time:2500});
				}
			});
	}

	function HiddenShowMoreComment(){
			var Comments=$('.ListComment .lists').length;
			if(parseInt(Comments/<?php echo $cfg_array['rows']; ?>)<1){
				$('.ShowMoreComment').hide();
			}else{
				$('.ShowMoreComment').show();
			}
	}

	HiddenShowMoreComment();
</script>
		 COMMENT--><?php endif; fun('label@run_comment_label','commentpc01',$info,['sysid'=>$sysid,'aid'=>$id,'status'=>'1','dirname'=>__FILE__,'tpl'=>'','cache_time'=>'0','rows'=>'5','where'=>'','order'=>'','by'=>'']); ?>
		<div class="ListArticBox">
		<?php if(defined('LABEL_DEBUG')): ?><!--LISTPAGE <!--news_list_page_listdata01		--><?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;if(( count($rs['picurls'])>3 )): ?>

<div class="ListArtic">
<div class="title"><a href="<?php echo $rs['url']; ?>"><?php echo $rs['title']; ?></a></div>
<ul class="morpic"><a href="<?php echo $rs['url']; ?>">
<?php if(is_array($rs['picurls']) || $rs['picurls'] instanceof \think\Collection || $rs['picurls'] instanceof \think\Paginator): $i = 0; $__LIST__ = $rs['picurls'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pic): $mod = ($i % 2 );++$i;if(($i<5)): ?>
	<li><span><img src="<?php echo $pic; ?>" style="max-width: 100%; max-height: 100%;"></span></li>
<?php endif; endforeach; endif; else: echo "" ;endif; ?>
</a></ul>
<dl class="moreinfo"><dt><span class="tou"><a href="<?php echo $rs['user_url']; ?>" target="_blank"><img src="<?php echo $rs['user_icon']; ?>"><?php echo $rs['username']; ?></a></span>浏览:<span><?php echo $rs['view']; ?></span>次 评论:<span><?php echo fun('comment@total',$rs['id']); ?></span>条</dt><dd><?php echo format_time($rs['create_time']); ?></dd></dl>
</div>
		
<?php elseif(( $rs['picurl']!='' )): ?>
<div class="ListArtic">
<ul class="pic_word">
	<ol><a href="<?php echo $rs['url']; ?>"><span><img src="<?php echo $rs['picurl']; ?>" onmouseover="thisimg_over($(this))" onmouseout="thisimg_out($(this))"></span></a></ol>
	<li><div class="title"><a href="<?php echo $rs['url']; ?>"><?php echo get_word($rs['title'],60); ?></a></div>
<p><?php echo get_word($rs['content'],200); ?></p>
<dl class="moreinfo"><dt><span class="tou"><a href="<?php echo $rs['user_url']; ?>" target="_blank"><img src="<?php echo $rs['user_icon']; ?>"><?php echo $rs['username']; ?></a></span>浏览:<span><?php echo $rs['view']; ?></span>次 评论:<span><?php echo fun('comment@total',$rs['id']); ?></span>条</dt><dd><?php echo format_time($rs['create_time']); ?></dd></dl>
</li>
</ul>
</div>
<?php else: ?>
<div class="ListArtic">
<ul class="pic_word">
	<li><div class="title"><a href="<?php echo $rs['url']; ?>"><?php echo get_word($rs['title'],60); ?></a></div>
<p><?php echo get_word($rs['content'],200); ?></p>
<dl class="moreinfo"><dt><span class="tou"><a href="<?php echo $rs['user_url']; ?>" target="_blank"><img src="<?php echo $rs['user_icon']; ?>"><?php echo $rs['username']; ?></a></span>浏览:<span><?php echo $rs['view']; ?></span>次 评论:<span><?php echo fun('comment@total',$rs['id']); ?></span>条</dt><dd><?php echo format_time($rs['create_time']); ?></dd></dl>
</li>
</ul>
</div>
<?php endif; endforeach; endif; else: echo "" ;endif; ?> LISTPAGE--><?php endif; $__array__=fun('label@run_listpage_label','news_list_page_listdata01',['mid'=>$mid,'fid'=>$fid,'page'=>$page,'dirname'=>__FILE__,'field'=>'','val'=>'','tpl'=>'','rows'=>'10','where'=>'','status'=>'','order'=>'list','by'=>'desc','cache_time'=>'0']);$pages=$__array__['pages'];$news_list_page_listdata01=$__array__['cfg']; ?>
		</div>
		<div class="ShowMoreArtic" style="display:none"><img src="/public/static/index/toutiao/timg.gif"><!--span onclick="ShowMoreArtic()">内容加载中</span--></div>
	</div>
<script type="text/javascript">
var Mpage = 1;
//显示更多
function ShowMoreList(){
	Mpage++;
	$.get('<?php fun('label@label_listpage_ajax_url','news_list_page_listdata01'); ?>'+Mpage,function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
			}else{
				$('.ListArticBox').append(res.data);
				scroll_get = true;  //这一行仅仅是匹配滚动显示更多.如果没使用滚动特效,可以删除
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}

//滚动显示更多
var scroll_get = true;	//做个标志,不要反反复复的加载
$(document).ready(function () {
	$(window).scroll(function () {
		if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
			scroll_get = false;
			layer.msg('内容加截中,请稍候',{time:1000});
			ShowMoreList();
		}
	});
});

</script>
	<div class="RightCont">
		<div class="NewMenmbers">
			<div class="head"><span>作者专栏</span></div>
			<div class="cont">
			<?php if(defined('LABEL_DEBUG')): ?><!--QB <!--member2	member	--><?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
				<ul><ol><a href="<?php echo $rs['url']; ?>"><img src="<?php echo $rs['icon']; ?>" onerror="this.src='/public/static/index/toutiao/nobody.gif'"></a></ol><li><div><?php echo $rs['username']; ?><span class="gz-btn">关注</span></div><p>粉丝：<?php echo fun("Count@Info","friend",["suid"=>$info['uid']]); ?>人</p></li></ul>
  <?php endforeach; endif; else: echo "" ;endif; ?> QB--><?php endif; $member2 = fun('label@run_label','member2',['val'=>'','conf'=>'','list'=>'rs','systype'=>'member','tpl'=>'','ifdata'=>1,'dirname'=>__FILE__,'rows'=>'5','class'=>'','order'=>'','by'=>'','where'=>'','whereor'=>'','sql'=>"",'js'=>'','cache_time'=>'0'  ]); ?>
			</div>
<script type="text/javascript">
$(function(){
	function gz(){
		$.get("<?php echo murl('member/wxapp.friend/add',['uid'=>$info['uid']]); ?>",function(res){
			if(res.code==0){
				$(".gz-btn").html('已关注').off("click").click(ungz);
				layer.msg(res.msg);
			}else{
				layer.alert(res.msg);
			}
		});
	}
	function ungz(){
		layer.confirm("你要取消关注吗?",{},function(){
			$.get("<?php echo murl('member/wxapp.friend/del',['uid'=>$info['uid']]); ?>",function(res){
				if(res.code==0){
					$(".gz-btn").html('关注').off("click").click(gz);
					layer.msg("你已取消关注");
				}else{
					layer.alert(res.msg);
				}
			});
		});
	}
	$.get("<?php echo murl('member/wxapp.friend/ckgz',['uid'=>$info['uid']]); ?>",function(res){
		if(res.code==0){
			$(".gz-btn").html('已关注').click(ungz);
		}else{
			$(".gz-btn").click(gz);
		}
	});
});
</script>
		</div>
		<div class="HotArticBox">
			<div class="head">热门信息</div>
			<div class="cont cont1">
			<?php if(defined('LABEL_DEBUG')): ?><!--QB <!--toutiaohot	cms	--><?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
			<div class="title"><a href="<?php echo $rs['url']; ?>"><?php echo $rs['title']; ?></a></div>
  <?php endforeach; endif; else: echo "" ;endif; ?> QB--><?php endif; $toutiaohot = fun('label@run_label','toutiaohot',['val'=>'','conf'=>'','list'=>'rs','systype'=>'cms','tpl'=>'','ifdata'=>1,'dirname'=>__FILE__,'rows'=>'15','class'=>'','order'=>'','by'=>'','where'=>'','whereor'=>'','sql'=>"",'js'=>'','cache_time'=>'0'  ]); ?>
			</div>
		</div>
		<div class="CopyRightBox">
			<div>Copyright@<?php echo $webdb[www_url]; ?> all rights reserved <br><a href="http://beian.miit.gov.cn" target="_blank"><?php echo $webdb[miibeian_gov_cn]; ?></a></div>
    		<div>Powered by <a href="http://www.qibosoft.com" target="_blank">qibosoft <?php echo $qibosoft_Edition; ?></a> Code &copy; 2018 <a href="http://bbs.qibosoft.com/" target="_blank">qibosoft</a></div><?php echo $webdb['copyright']; ?>
		</div>
	</div>
</div>
<script>
function doZoomSize(size){
	$('.ArticleContent').css({'font-size':size+'px'});
	if(size>16){
		$('.ArticleContent').css({'line-height':'35px'});
	}else if(size>13){
		$('.ArticleContent').css({'line-height':'25px'});
	}else{
		$('.ArticleContent').css({'line-height':'20px'});
	}
}
$(document).ready(function () {
	var rightBoxH=$('.MainContainer .RightCont').height();
	$(window).scroll(function () {
		var scroll_Height=$(window).scrollTop();
		if (scroll_Height > 50) {
			$(".MainContainer .LeftCont").css({'top':scroll_Height+'px'});
		}else{
			$(".MainContainer .LeftCont").css({'top':'0px'});
		}
		if(scroll_Height>rightBoxH){
			$('.HotArticBox').addClass('HotArticBox1');
			$(".HotArticBox").css({'top':scroll_Height+'px'});
		}else{
			$('.HotArticBox').removeClass('HotArticBox1');
		}
		if($('body').height()-scroll_Height<1300 && check_showMore==1){
			ShowMoreArtic();
		}
	});
});
$('.RightSideBox .cont ul ol a img').hover(
	function(){
		$(this).animate({"max-width":"120%","max-height":"120%"},100);
	},
	function(){
		$(this).animate({"max-width":"100%","max-height":"100%"},100);
	}
);
function thisimg_over(objs){
	objs.animate({"max-width":"120%","max-height":"120%"},100);
}
function thisimg_out(objs){
	objs.animate({"max-width":"100%","max-height":"100%"},100);
}
</script>

<!--下面是钩子插件,做风格的时候尽量加上,方便扩展-->
<?php echo hook_listen('layout_body',$userdb,['webdb'=>$webdb,'info'=>$info],true); ?>
<link rel="stylesheet" type="text/css" href="/public/static/index/toutiao/foot.css">
<div id="copyright">
    <div>Copyright@<?php echo $webdb[www_url]; ?> all rights reserved <a href="http://beian.miit.gov.cn" target="_blank"><?php echo $webdb['miibeian_gov_cn']; ?></a></div>
    <div></div>
	<?php echo $webdb['copyright']; ?>
</div>
<!-- 在线客服 开始 -->
<div id="top"></div>
<!-- 在线客服 结束 -->
<?php if($webdb['weixin_type']==3&&$userdb['weixin_api']!=''): ?>
<script type="text/javascript">
if($.cookie('mp_gz_remind')!='no'&&"<?php echo $userdb['uid']; ?>"!=''){
$.get("<?php echo purl('weixin/check/ifgz',[],'index'); ?>",function(res){
	if(res.code==1){
		layer.open({
			type: 1
			,offset: 'rb'
			,anim:2
			,title:'亲!欢迎关注公众号'
			,area:['280px','280px']
			,content: '<div style="padding: 10px;text-align:center;"><span style="font-size:12px;">你还没有关注公众号,请关注可以享受更多权益!</span><br><img src="<?php echo tempdir($webdb['mp_code_img']); ?>" style="width:180px;height:180px;"></div>'        
			,shade: 0 //不显示遮罩 
			,cancel: function(index, layero){
				$.cookie('mp_gz_remind', 'no', { expires: 60, path: '/' });   //60分钟提醒一次用户关注公众号
			}
		});
	}
});
}
</script>
<?php endif; ?><!--若没有关注微信公众号,就做个提醒-->
<!--下面是钩子插件,做风格的时候尽量加上,方便扩展-->
<?php echo hook_listen('layout_body_foot',$userdb,['webdb'=>$webdb,'info'=>$info],true); ?>
<script type="text/javascript" src="/public/static/js/qibo.js"></script>
</body>
</html>